<!DOCTYPE html>

<html>
<head>
	<title>AIL-Framework</title>
	<link rel="icon" href="{{ url_for('static', filename='image/ail-icon.png')}}">
	<!-- Core CSS -->
	<link href="{{ url_for('static', filename='css/bootstrap4.min.css') }}" rel="stylesheet">
	<link href="{{ url_for('static', filename='css/font-awesome.min.css') }}" rel="stylesheet">
	<link href="{{ url_for('static', filename='css/dataTables.bootstrap.min.css') }}" rel="stylesheet">
	<link href="{{ url_for('static', filename='css/tags.css') }}" rel="stylesheet" type="text/css" />

	<!-- JS -->
	<script src="{{ url_for('static', filename='js/jquery.js')}}"></script>
	<script src="{{ url_for('static', filename='js/popper.min.js')}}"></script>
  <script src="{{ url_for('static', filename='js/bootstrap4.min.js')}}"></script>
  <script src="{{ url_for('static', filename='js/jquery.dataTables.min.js')}}"></script>
	<script src="{{ url_for('static', filename='js/dataTables.bootstrap.min.js')}}"></script>
	<script src="{{ url_for('static', filename='js/tags.js') }}"></script>

</head>

<body>

	{% include 'nav_bar.html' %}

	<div class="container-fluid">
		<div class="row">

			{% include 'settings/menu_sidebar.html' %}

			<div class="col-12 col-lg-10" id="core_content">

						<div class="card my-3">
						  <div class="card-header bg-dark text-white">
								<h5 class="card-title">Create SYNC Queue</h5>
							</div>
						  <div class="card-body">

								<form action="{{ url_for('ail_2_ail_sync.sync_queue_add') }}" method='post' onsubmit="SubmitCreateQueue();">

									<div class="row">
										<div class="col-12 col-xl-9">
											<div class="input-group mb-2 mr-sm-2">
										    <div class="input-group-prepend">
										      <div class="input-group-text bg-dark text-white"><i class="fas fa-quote-right"></i></div>
										    </div>
												<input id="queue_name" name="queue_name" class="form-control" placeholder="Queue Name" type="text" required>
										  </div>

											<div class="input-group form-group mb-2">
												<div class="input-group-prepend">
													<span class="input-group-text bg-success"><i class="fas fa-water"></i></span>
												</div>
												<input class="form-control" type="number" id="queue_max_size" name="queue_max_size" min="1" value="100" required>
												<div class="input-group-append">
													<span class="input-group-text">Queue Max Size</span>
											  </div>
											</div>

											<div class="input-group mb-2 mr-sm-2">
										    <div class="input-group-prepend">
										      <div class="input-group-text bg-info text-white"><i class="fas fa-pencil-alt"></i></div>
										    </div>
												<textarea id="queue_description" name="queue_description" class="form-control" placeholder="Sync Queue Description (optional)" rows="3"></textarea>
										  </div>

											<div class="card my-4">
											  <div class="card-header bg-secondary text-white">
													<b>Tags Filter</b>
												</div>
											  <div class="card-body">
													{% include 'tags/block_tags_selector.html' %}
												</div>
											</div>

										</div>
										<div class="col-12 col-xl-3">
											SYNC: create a new Sync Queue
										</div>
									</div>

									<br>
									<button class="btn btn-primary mt-2">
										<i class="fas fa-plus"></i> Create Sync Queue
									</button>

								</form>



						  </div>
						</div>


			</div>

		</div>
	</div>

</body>

<script>
$(document).ready(function(){
	$('#nav_sync').removeClass("text-muted");
	$("#navsync_queues").addClass("active");

});

function toggle_sidebar(){
	if($('#nav_menu').is(':visible')){
		$('#nav_menu').hide();
		$('#side_menu').removeClass('border-right')
		$('#side_menu').removeClass('col-lg-2')
		$('#core_content').removeClass('col-lg-10')
	}else{
		$('#nav_menu').show();
		$('#side_menu').addClass('border-right')
		$('#side_menu').addClass('col-lg-2')
		$('#core_content').addClass('col-lg-10')
	}
}

function SubmitCreateQueue() {
	var tags = ltags.getValue();
	var tagsgalaxy = ltagsgalaxies.getValue();
	$('#ltags').val(tags);
	$('#ltagsgalaxies').val(tagsgalaxy);
	return true;
}

</script>
